package com.data.center.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

import com.data.center.annotation.ForeignInfo;
import com.data.center.service.impl.StaffServiceImpl;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;

/**
 * <p>
 * 
 * </p>
 *
 * @author 
 * @since 2023-12-05 03:29:24
 */
@Getter
@Setter
@TableName("staff")
@ApiModel(value = "Staff对象", description = "")
public class Staff implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty("人员ID")
    @TableId("staff_id")
    private String staffId;

    @ApiModelProperty("组织ID ")
    @TableField("organization_id")
    @ForeignInfo(targetClass = Organization.class,
            foreignKey = "organizationId",
            serviceClass = StaffServiceImpl.class,
            searchByForeignKeyMethodName = "searchByOrganizationId",
            deleteByForeignKeyMethodName = "deleteByOrganizationId",
            mergeByForeignKeyMethodName = "mergeByOrganizationId")
    private String organizationId;

    @ApiModelProperty("姓名 ")
    @TableField("name")
    private String name;

    @ApiModelProperty("手机")
    @TableField("mobile")
    private String mobile;

    @ApiModelProperty("电话")
    @TableField("telephone")
    private String telephone;

    @ApiModelProperty("邮箱")
    @TableField("email")
    private String email;

    @ApiModelProperty("传真")
    @TableField("fax")
    private String fax;

    @ApiModelProperty("职务 ")
    @TableField("position")
    private String position;

    @ApiModelProperty("状态 ")
    @TableField("status")
    private String status;

    @ApiModelProperty("创建人 ")
    @TableField("creator")
    private String creator;

    @ApiModelProperty("创建时间 ")
    @TableField("creation_time")
    private Date creationTime;

    @ApiModelProperty("最后修改人 ")
    @TableField("modifier")
    private String modifier;

    @ApiModelProperty("最后修改时间 ")
    @TableField("last_modified_time")
    private Date lastModifiedTime;


    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof Staff)) return false;
        Staff staff = (Staff) o;
        return Objects.equals(getStaffId(), staff.getStaffId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getStaffId());
    }
}
